#!/usr/local/bin/python3
# -*- coding: UTF-8 -*-
"""
@author:apple
@file:demo02.py
@time:2021/05/25

### 1. vars()

### 2. format 获取字典和数组


### 3. in/is
> 字符串/list/dict


> not in

### if
```python

age = 10

print(5 < age < 30)

```

### 浅拷贝/深拷贝

- 深拷贝
    对不可变对象使用原来对，对可变类型拷贝之前的创建一个新对象

### while/for/ / else
    while不被break打断就会执行else里面的代码

"""


def test01():
    ...
    name = 'zhangsan'
    # 如果vars没传递参数，就是获取当前命名空间的local()的值
    print(vars())
    names = ['lisi', 'wangwu']
    print('name1:{0[0]},name2:{0[1]}'.format(names))


def test02():
    ...
    from copy import deepcopy

    a = ['12']
    person = {'name':'zhansan', 'age':a}
    dp = deepcopy(person)
    print(id(person['age']),id(dp['age']))


def test03():
    ...
    n1 = [1,2,3,4,5]
    print(n1.pop(-1))
    print(n1)
    for index,val in enumerate(n1):
        print(index,val)

if __name__ == '__main__':
    pass
    test03()
